
<div class="row">
<?if(isset($system_message))echo $system_message;?>
<?echo $this->pagination->create_links();?>
<div>
	<p class="lead-title">Grading Period</p>

	
	<?if(!empty($grading_period_data)):?>
	<table class="table table-striped">
		<thead class="tabular-head">
			<tr>
				<th>Grading Period Code</th>
				<th>Grading Period Description</th>
				<th>Grading Period Status</th>
				<th>&nbsp;</th>
			</tr>
		</thead>
			<tbody class="tabular">
		<?foreach($grading_period_data as $gpd):?>
			<tr>
				<td><?=$gpd->gp_code;?></td>
				<td><?=$gpd->gp_desc;?></td>
				<td><?=$gpd->gp_stat;?></td>
				<td>
					<div class="btn-group">
						<a href="<?=site_url('admin/update_grading_period').'/'.$gpd->gp_id;?>" class="btn btn-mini btn-primary confirm" title="update <?echo $gpd->gp_desc;?>"><i class="icon-pencil"></i> Edit</a>
						<?if($gpd->is_set !== 'yes'):?>
							<a href="<?=site_url('admin/set_gp').'/'.$gpd->gp_id;?>" class="btn btn-mini btn-success confirm" title="set <?php echo $gpd->gp_desc;?> as current grading period?"><i class="fa fa-square"></i>&nbsp;&nbsp;Set as Current</a>
						<?else:?>
							<a class="btn btn-mini"><i class="fa fa-check-square-o"></i>&nbsp;&nbsp;Selected</a>
						<?endif;?>						
						<?if($gpd->gp_stat == 'active'):?>
						<a href="<?=site_url('admin/destroy_gp').'/'.$gpd->gp_id;?>" class="btn btn-mini btn-danger confirm"><i class="icon-remove"></i> Disable</a>
						<?else:?>
						<a href="<?=site_url('admin/undestroy_gp').'/'.$gpd->gp_id;?>" class="btn btn-mini btn-success confirm"><i class="icon-ok"></i> Enable</a>
						<?endif;?>
					</div>
				</td>
			</tr>
		<?endforeach;?>
		<!--
		<tr><td><a href="<?=site_url('admin/add_grading_period')?>" class="add">Add Grade Period</a></td></tr>
		-->
		</tbody>
	</table>
	<?else:?>
		<div class="notice">No Grading period available <a href="<?=site_url('admin/add_grading_period')?>" class="add">Add Grade Period</a></div>
	<?endif;?>
</div>

</div>